{% extends "orga/base.html" %}

{% load i18n %}
{% load rich_text %}
{% load rules %}

{% block extra_title %}{% translate "Attendee feedback" %} :: {% endblock extra_title %}

{% block content %}
    <div id="main-title" class="d-md-flex justify-content-between">
        <h2>{% translate "Attendee feedback" %}</h2>
        {% include "orga/event/component_link.html" %}
    </div>

    {% regroup feedback|dictsort:"talk.title" by talk.title as feedbacks_list %}

    {% for submission in feedbacks_list %}
        <h4>
            {% translate "Feedback" %}: {{ quotation_open }}<a href="{{ submission.list.0.talk.orga_urls.feedback }}">{{ submission.grouper }}</a>{{ quotation_close }}
        </h4>

        {% for entry in submission.list %}
            {% has_perm "base.view_feedback_submission" request.user entry.talk as can_see_feedback %}
            {% if can_see_feedback %}
                <div class="card mb-2">
                    <div class="card-body pb-0">{{ entry.review|rich_text }}</div>
                </div>
            {% endif %}
        {% endfor %}
        <br>
        <br>
    {% empty %}
        {% translate "There has been no feedback for sessions in this event yet." %}
    {% endfor %}

    {% include "orga/includes/pagination.html" %}

{% endblock content %}
